#ifndef GYRO_FLOW_PORT_HASHMAP_H
#define GYRO_FLOW_PORT_HASHMAP_H


#define INITIAL_CAPACITY 16

// 键-值对结构
typedef struct KeyValuePair {
    char* key;
    int value;
    struct KeyValuePair* next;
} KeyValuePair;


// 哈希表结构
typedef struct {
    int capacity;
    int size;
    KeyValuePair** table;
} HashMap;


unsigned int hash(const char* key, int capacity);

HashMap* createHashMap();

void put(HashMap* map, const char* key, int value);

int get(HashMap* map, const char* key);

void destroyHashMap(HashMap* map);




#endif //GYRO_FLOW_PORT_HASHMAP_H
